<style>
	.vaddcolor{color:red; margin-left:5px;}
	table { width:100%;}
	table tr td{padding:3px; text-align:right;}
	table tr td input[type=text]{text-align:left;}
	.error_valid_admin{
		color: #FF0000;
		font-size: 11px;
		padding: 5px;
		position: absolute;
		margin-top:-13px;
	}
	.admin_btn{
	background-color: #B20D65;
    border-radius: 3px;
    color: #FFFFFF;
    line-height: 20px;
    margin-top: 4px;
    padding: 0 9px 0 8px;
	
	}
</style>
<html>
	<body>
		<!--CONTENT SECTION START-->
		<div style="">
		<div id="main-wrapper-sec">
			<section>
				<!--INNER MAIN TITLE SECTION START--
				<!--INNER MAIN TITLE SECTION END-->
				<!--CONTENT MAIN SECTION START-->
					<!--INNER CONTENT LEFT SECTION START--> 
					<div class="" style="width:28%; margin:0 auto; margin-top:20px;min-height:360px;">
						  <h2 class="or-pp-sec"><span class="fleft">Add country Details</span></h2>
						  <form id="formid" enctype="multipart/form-data" method="POST" name="formid" action="" onsubmit="return adminValidate();"> 
						  <table>
						  <tr>
								<td>Country Code :</td><td>
								  <input type="text" name="country_id" id="country_id" value="<?php if(isset($this->editDetails->country)){echo $this->editDetails->country_id;}?>"/></td>
								 <td><span class="error_valid_admin" id="error_country_id"></span></td>
								  </tr>
								  
								  <tr> <td>Country Name :</td>
								  <td><input type="text" name="country" id="country" value="<?php if(isset($this->editDetails->country)){echo $this->editDetails->country;}?>"/></td>
								  <td><span class="error_valid_admin" id="error_country"></span></td>
								  </tr>
								  <tr><td>Mobile Cost :</td><td><input type="text" name="mobile" id="mobile" value="<?php if(isset($this->editDetails->country)){echo $this->editDetails->mobile;}?>" /></td>
								  <td><span class="error_valid_admin" id="error_mobile"></span></td></tr>
								  <tr><td>Land-line Cost :</td><td><input type="text" name="landline" id="landline" value="<?php if(isset($this->editDetails->country)){echo $this->editDetails->landline;}?>" /></td>
								  <td><span class="error_valid_admin" id="error_landline"></td></tr>
								  <tr><td>Price :</td><td><input type="text" name="price" id="price" value="<?php if(isset($this->editDetails->country)){echo $this->editDetails->price;}?>" /></td>
								  <td><span class="error_valid_admin" id="error_price"></td></tr>
								  </table>
								  <table>
								  <tr><td style="margin:10px 0px 0px 0px;">Image :</td><td><input type="file" name="file" id="file" value=""/><span id="hide"><?php $a=$this->basePath();$a.="/uploads/";$a.=$this->editDetails->image;?> <img src="<?php echo $a; ?>" /></span> </td>
								  <td><span class="error_valid_admin" id="error_image"></td></tr>
								  </table>
								  <input type="hidden" id="hidsno" name="hidsno" value="<?php if(isset($this->editDetails->country)){echo $this->editDetails->sno;}?>">
								   <input type="hidden" id="imag" name="imag" value="<?php if(isset($this->editDetails->image)){echo $this->editDetails->image;}?>">
								 <center><input class="" type="submit" value="Save"></center>
							</form>
					  </div>
				</section>
		</div>
		</div>
	</body>
</html>
<script>
function adminValidate()
{
	var flag=true;	
	if($('#country_id').val()==""){		
		$('#error_country_id').html('Required');
		flag=false;
	}else{
		$('#error_country_id').html('');
	}
	if($('#country').val()==""){		
		$('#error_country').html('Required');
		flag=false;
	}else{
		$('#error_country').html('');
	}
	if($('#mobile').val()==""){		
		$('#error_mobile').html('Required');
		flag=false;
	}else{
		$('#error_mobile').html('');
	}
	if($('#landline').val()==""){		
		$('#error_landline').html('Required');
		flag=false;
	}else{
		$('#error_landline').html('');
	}
	if($('#price').val()==""){		
		$('#error_price').html('Required');
		flag=false;
	}else{
		$('#error_price').html('');
	}
	if($('#file').val()=="" && $('#imag').val()==""){		
		$('#error_image').html('Required');
		flag=false;
	}else{
		$('#error_image').html('');
	}
	if(flag==false){
			return false;
		}else{
			return true;
		}
}
 $(function()
  {
    $('#file').change( function()
    {
	$('#hide').hide();
     });
  });
</script>
